<?php
require_once("includes/Includes.php");
require_once("includes/User_type.class.php");

  if($session->is_logged_in())
    { 
     $user_ID = $_SESSION["user_ID"];
     $user_type_ID = User::find_user_type($user_ID);
     $user_type = User_type::find_user_type_name($user_type_ID);

     if($user_type == "admin")
     {
     	header("Location: admin/faculty_home.php");
     }
     else if(($user_type == "doctor") || ($user_type == "teacher"))
     {
       header("Location: staff/staff_home.php");
     }
     else if ($user_type == "student")
     {
       header("Location: student/student_home.php");
     }
    }
  else
    {
     header("Location: user/login.php");
    }
?>